package com.ccys.cms.service.inventory.impl;

import com.ccys.cms.service.inventory.StaffPurchaseService;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.web.inventory.StaffPurchasePageDto;
import com.ccys.db.entity.TblStaffPurchase;
import com.ccys.db.mapper.TblStaffPurchaseMapper;
import com.ccys.db.page.PageDto;
import com.ccys.db.rely.service.impl.BaseServiceImpl;
import com.ccys.db.vo.web.inventory.ExchangeOrderVo;
import com.ccys.db.vo.web.inventory.StaffPurchaseInfoVo;
import com.ccys.db.vo.web.inventory.StaffPurchaseVo;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
@Slf4j
public class StaffPurchaseServiceImpl extends BaseServiceImpl<TblStaffPurchase> implements StaffPurchaseService {

    @Resource
    private TblStaffPurchaseMapper mapper;
    @Override
    public ResponseResult getPage(StaffPurchasePageDto dto) {
        PageDto.startPage();
        List<StaffPurchaseVo> list = mapper.getList(dto);
        PageInfo<StaffPurchaseVo> info = new PageInfo<>(list);
        return ResponseResult.success(info);
    }

    @Override
    public StaffPurchaseInfoVo getInfo(String id) {

        return mapper.getInfo(id);
    }
}
